#include <bits/stdc++.h>

#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using vec = vector < int >;
using veg = vector < pii >;

template < typename T > T read() {
	T x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-', ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

template < typename T > void chkmax(T &x, const T &y) { x = x > y ? x : y; }
template < typename T > void chkmin(T &x, const T &y) { x = x < y ? x : y; }

ll f[2][1 << 9][85];
int n, K;

int main() {
#ifdef YJR_2333_TEST
	freopen("1.in", "r", stdin);
#endif
	n = in, K = in;
	int o = 0, U = 1 << n; f[o][0][0] = 1; 
	for(int i = 1; i <= n; i++, o ^= 1) {
		rep(s, 0, U - 1)
			if(!(s & s >> 1) && !(s & s << 1))
				rep(c, 0, K) if(f[o][s][c]) {
					int us = (U - 1) ^ s;
					for(int t = us; ; t = (t - 1) & us) {
						if(!(t & t << 1) && !(t & t >> 1) && !(s & t << 1) && !(s & t >> 1) && !(s & t)) {
							int nc = c + __builtin_popcount(t);
							if(nc <= K) f[o ^ 1][t][nc] += f[o][s][c];
						}
						if(t == 0) break;
					} f[o][s][c] = 0;
				}
	}
	ll ans = 0; rep(s, 0, U - 1) ans += f[o][s][K];
	cout << ans << endl;
	return 0;
}
